//
//  UIBarButtonItem+Extension.m
//  1.28  weibo
//
//  Created by mac on 15/1/30.
//  Copyright (c) 2015年 mac. All rights reserved.
//

#import "UIBarButtonItem+Extension.h"

@implementation UIBarButtonItem (Extension)

//封装方法
+ (UIBarButtonItem *)itmeWith:(NSString *)image highlightedImage:(NSString *)higImage target:(id)target action:(SEL)action
{
    
    UIButton *btn = [[UIButton alloc] init];
    [btn setImage:[UIImage imageNamed:image] forState:UIControlStateNormal];
    [btn setImage:[UIImage imageNamed:higImage] forState:UIControlStateHighlighted];
    btn.size = btn.currentImage.size;
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    return  [[UIBarButtonItem alloc] initWithCustomView:btn];
    
}



@end
